import { Component, Vue } from 'vue-property-decorator'
import { namespace } from 'vuex-class'

const module = namespace('cms')

@Component
export default class Auth extends Vue {
  // Vuex
  @module.State access_token!: string
  @module.State user_info!: any
  @module.Getter is_logged_in!: boolean
  @module.Action getAuth!: () => void
  
  /*----- 钩子 -----*/
  public created() {
    this.getAuth()
    // console.log(this.access_token, this.user_info, this.is_logged_in)
    console.log(this.is_logged_in, (this.is_logged_in ? '已登录' : '未登录'))
  }
}
